home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 4053 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.5 KB

  1. Path: airdmhor.gen.nz!not-for-mail
  2. From: gumboot@airdmhor.gen.nz (Simon Hosie)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: division problem
  5. Date: 2 Feb 1996 04:28:26 +1300
  6. Organization: Airdmhor
  7. Message-ID: <4eqm6q$bdk@airdmhor.gen.nz>
  8. References: <31097D77.11AA@rain.org> <26JAN199622082450@erich.triumf.ca> <4eh246$u6h@airdmhor.gen.nz> <4ej4ha$66@fountain.mindlink.net> <DLzvGG.2rn@uns.bris.ac.uk> <4emuba$1mo@fountain.mindlink.net> <823118692snz@genesis.demon.co.uk>
  9. NNTP-Posting-Host: localhost.gen.nz
  10. X-Newsreader: TIN [version 1.2 PL2]
  11.  
  12. > Still no need to use floating point,
  13. > celcius = ((fahrenheit - 32) * 5 + 4) / 9
  14.  
  15. genew@mindlink.bc.ca "Gene Wirchenko" writes:
  16. > Let's assume that you had never run across fahrenheit to celsius
  17. > conversion before (because the above could just as easily be a case of
  18. > converting flibbles to meeblesnauzers).
  19. >
  20. >     Can you derive the ORIGINAL formula for conversion of F to C?
  21. >
  22. >     If yes, how?  Because you don't know what the 4 is for.
  23.  
  24. Lawrence Kirby:
  25. > Maybe not but its effect is clearly one of rounding. Perhaps it would be
  26. > clearer to specify it as (9/2), perhaps not.
  27.  
  28.   It's not perfect rounding (you should have seen my examply by now).  And
  29. you can get the original formula back as long as you know that you're
  30. working with integers.
  31.  
  32.  
  33. genew@mindlink.bc.ca "Gene Wirchenko" writes:
  34. > If no, then it's unclear code, isn't it?
  35.  
  36. Lawrence Kirby:
  37. > How would you express it more clearly?
  38.  
  39.   I'd just put a comment next to it if I thought it was necessary.
  40.